﻿using StandXunYouServer.IRepository;
using StandXunYouServer.Utility;
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Text;

namespace StandXunYouServer.Repository
{
    public class BaseConnection : IBaseConnection
    {
        private readonly IConfiguration _configuration;

        public BaseConnection(IConfiguration configuration)
        {
            _configuration = configuration;
        }

        public SqlConnection GetConn()
        {
            //获取连接数据库的字符串
            var str = _configuration["AppCode:Secret"]; 
            //var conn = new SqlConnection(AESEncryptHelper.Decode(str));
            var conn = new SqlConnection(str);
            return conn;
        }

    }
}
